﻿//========================================================= 
/**@file FolderAppender.h
 * @brief 对FolderLogger的ILogCat接口封装
 * 
 * @date 2018-06-19   18:32:56
 * @author Zhyioo 
 * @version 1.0
 */ 
//--------------------------------------------------------- 
#ifndef _LIBZHOUYB_FOLDERAPPENDER_H_
#define _LIBZHOUYB_FOLDERAPPENDER_H_
//--------------------------------------------------------- 
#include "../ILogCat.h"

#include "../../ability/logger/FolderLogger.h"
using zhou_yb::extension::ability::FolderLogger;
//--------------------------------------------------------- 
namespace zhou_yb {
namespace extension {
namespace logcat {
//--------------------------------------------------------- 
/// 将日志输出到Logger中
template<class T>
class LoggerTAppender : public ILogAppender, public T
{
public:
    virtual void append(LogLevel lv, const char* tag, const char* str)
    {
        this->operator<<(str);
        this->operator<<(std::endl);
        this->Flush();
    }
};
/// 将日志输出到文件夹中
typedef LoggerTAppender<FolderLogger> FolderAppender;
//--------------------------------------------------------- 
} // namespace logcat
} // namespace extension
} // namespace zhou_yb
//--------------------------------------------------------- 
#endif // _LIBZHOUYB_FOLDERAPPENDER_H_
//========================================================= 